package com.yuanqi.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;

/**
 * 客户对账单表
 * @TableName customer_reconciliation
 */
@TableName(value ="customer_reconciliation")
@Data
public class CustomerReconciliation implements Serializable {
    /**
     * 主键
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 客户ID
     */
    private Long customerId;

    /**
     * 对账周期（如202408）
     */
    private String reconPeriod;

    /**
     * 应收总额
     */
    private BigDecimal totalReceivable;

    /**
     * 已收总额
     */
    private BigDecimal totalReceived;

    /**
     * 对账状态（0-未对账/1-已对账）
     */
    private Integer reconStatus;

    /**
     * 
     */
    private Date createTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        CustomerReconciliation other = (CustomerReconciliation) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getCustomerId() == null ? other.getCustomerId() == null : this.getCustomerId().equals(other.getCustomerId()))
            && (this.getReconPeriod() == null ? other.getReconPeriod() == null : this.getReconPeriod().equals(other.getReconPeriod()))
            && (this.getTotalReceivable() == null ? other.getTotalReceivable() == null : this.getTotalReceivable().equals(other.getTotalReceivable()))
            && (this.getTotalReceived() == null ? other.getTotalReceived() == null : this.getTotalReceived().equals(other.getTotalReceived()))
            && (this.getReconStatus() == null ? other.getReconStatus() == null : this.getReconStatus().equals(other.getReconStatus()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getCustomerId() == null) ? 0 : getCustomerId().hashCode());
        result = prime * result + ((getReconPeriod() == null) ? 0 : getReconPeriod().hashCode());
        result = prime * result + ((getTotalReceivable() == null) ? 0 : getTotalReceivable().hashCode());
        result = prime * result + ((getTotalReceived() == null) ? 0 : getTotalReceived().hashCode());
        result = prime * result + ((getReconStatus() == null) ? 0 : getReconStatus().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", customerId=").append(customerId);
        sb.append(", reconPeriod=").append(reconPeriod);
        sb.append(", totalReceivable=").append(totalReceivable);
        sb.append(", totalReceived=").append(totalReceived);
        sb.append(", reconStatus=").append(reconStatus);
        sb.append(", createTime=").append(createTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}